import jdk.jfr.StackTrace;
import org.junit.Test;
import pojo.huodongfabu;

import java.sql.*;

import static org.junit.Assert.assertEquals;
import static pojo.Mysql.*;

public class test {


    @Test
    public void testAdd() {
        try (
                Connection connection = DriverManager.getConnection(url, user, dbPassword)) {
            String query = "SELECT * FROM huodongfabu LIMIT ?, ?";
            try (PreparedStatement preparedStatement = connection.prepareStatement(query)) {
                preparedStatement.setInt(1, 1);
                preparedStatement.setInt(2, 5);

                try (ResultSet resultSet = preparedStatement.executeQuery()) {
                    while (resultSet.next()) {
                        String name = resultSet.getString("name");
                        String id = resultSet.getString("id");
                        String createtime = resultSet.getString("createtime");
                        String neirong = resultSet.getString("neirong");

                    }
                }
            }
        } catch (
                SQLException e) {
            e.printStackTrace();
        }
    }

    @Test
    public void test(){

    }
}
